package com.test.shiro.service.impl;

import com.test.shiro.domain.PowerRepository;
import com.test.shiro.service.PowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public class PowerServiceImpl implements PowerService {
    @Autowired
    private PowerRepository powerRepository;
    @Override
    public List<String> findPermissions(List<Integer> pids) {
       return powerRepository.findAllById(pids).stream().map(e->e.getPinfo()).collect(Collectors.toList());
    }
}
